package com.sx.pipeline.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.sx.pipeline.R
import com.sx.pipeline.app.config.WithDrawType
import com.sx.pipeline.repos.http.res.BalanceRecordVO
import com.sx.pipeline.repos.http.res.WithdrawRecordVO

/**
 * @Author：YY
 * @Date：2022/2/10
 * @Describe: 钱包记录列表适配器
 */
class WithdrawRecordAdapter(dataList: MutableList<WithdrawRecordVO>) : BaseQuickAdapter<WithdrawRecordVO, BaseViewHolder>(
    R.layout.item_withdraw_detail, dataList) {
    override fun convert(holder: BaseViewHolder, item: WithdrawRecordVO) {
        holder.setText(R.id.tv_name,item.name)
        holder.setText(R.id.tv_time,item.createTime)
        holder.setText(R.id.tv_money,item.reflectMoney)
        holder.setText(R.id.tv_remark,item.remark)
        when(item.status){
            WithDrawType.PENDING_REVIEW.code->{
                holder.setText(R.id.tv_status,"审核中")
                holder.setGone(R.id.tab_reason,true)
            }
            WithDrawType.TO_BE_INQUIRED.code->{
                holder.setText(R.id.tv_status,"已通过")
                holder.setGone(R.id.tab_reason,true)
            }
            WithDrawType.REJECTED.code->{
                holder.setText(R.id.tv_status,"已驳回")
                holder.setVisible(R.id.tab_reason,true)
            }
        }

    }
}